#include "Point.h"
#include "Matrice.h"
#include "Vecteur.h"

Point::Point(double a, double b, double c) : x(a), y(b), z(c), t(1.0) {}

Point Point::operator *(const Matrice &m) {
	Point p;
	p.x = x*m.getElem(0,0) + y*m.getElem(1,0) + z*m.getElem(2,0) + t*m.getElem(3,0);
	p.y = x*m.getElem(0,1) + y*m.getElem(1,1) + z*m.getElem(2,1) + t*m.getElem(3,1);
	p.z = x*m.getElem(0,2) + y*m.getElem(1,2) + z*m.getElem(2,2) + t*m.getElem(3,2);
	p.t = x*m.getElem(0,3) + y*m.getElem(1,3) + z*m.getElem(2,3) + t*m.getElem(3,3);
	return p;
}
Point Point::operator +(const Vecteur &v) {
	Point p;
	p.x = x+v.getX();
	p.y = y+v.getY();
	p.z = z+v.getZ();
	return p;
}